<#import "/global.ftl" as user_add />
<form id="userEditForm" method="post">
        <div>
            <label for="LoginName">LoginName:</label>
            <input class="easyui-validatebox" type="text" id="loginName" name="systemUser.loginName" data-options="required:true"
        <#if "edit"==pageType> disabled="true" </#if> value="${systemUser.loginName}"/>
        </div>
        <#if "add"==pageType>
        <div>
            <label for="LoginPassword">LoginPassword:</label>
            <input class="easyui-validatebox" type="text" id="loginPassword" name="systemUser.loginPassword"
                   data-options="required:true" value="${systemUser.loginPassword}"/>
        </div>
        </#if>
    <div>
        <label for="userName">UserName:</label>
        <input class="easyui-validatebox" type="text" id="userName" name="systemUser.userName"
               data-options="required:true" value="${systemUser.userName}"/>
    </div>
    <div>
        <label for="realName">RealName:</label>
        <input class="easyui-validatebox" type="text" id="realName" name="systemUser.realName"
               data-options="required:true" value="${systemUser.realName}"/>
    </div>
    <div>
        <label for="sex">Sex:</label>
        <input class="easyui-validatebox" type="text" id="sex" name="systemUser.sex"
               data-options="required:true" value="${systemUser.sex}" />
    </div>
    <div>
        <label for="age">Age:</label>
        <input class="easyui-validatebox" type="text" id="age" name="systemUser.age"
               data-options="required:true" value="${systemUser.age}" />
    </div>
    <div>
        <label for="status">Status:</label>
        <input class="easyui-validatebox" type="text" id="status" name="systemUser.status"
               data-options="required:true" value="${systemUser.status}"/>
    </div>
    <div>
        <label for="email">Email:</label>
        <input class="easyui-validatebox" type="text" id="email" name="systemUser.email"
               data-options="required:true" value="${systemUser.email}"/>
    </div>
    <div>
        <label for="telephone">Telephone:</label>
        <input class="easyui-validatebox" type="text" id="telephone" name="systemUser.telephone"
               data-options="required:true" value="${systemUser.telephone}"/>
    </div>
    <input type="hidden" name="pageType" value="${pageType}" />
    <input type="hidden" name="systemUser.accountId" value="${systemUser.accountId}" />
</form>
<script type="text/javascript">
    function editSubmit(){
        $.post('<@user_add.basePath/>/sys/user/save',
                $("#userEditForm").serialize(),
                function(data){
                    console.log(data);
                    if(true==data.success){
                        $("#userTables").datagrid('reload');
                        $('#addUserDiv').dialog('close');
                    } else {
                        $.messager.alert('error',data.message);
                    }
                });
    }

</script>

